<template>
<div>
    <gridView :url="url" :menuId="menuId" @otherClick="otherClick"></gridView>
    <importModel ref="importModel"></importModel>
</div>
</template>


<script>

import gridView from "@/components/common/gridView.vue";
import importModel from "./importModel.vue";
export default {
    data() {
        return {
            url:'',
            menuId:1
        };
    },
    created() {
        var url = this.$route.path;
        url = '/java'+url.substring(0, url.lastIndexOf('index')-1);
        this.url = url;
        this.menuId = this.$route.params.menuId;
    },
  
    mounted() {
        var _this = this;
    },
    methods: {
        otherClick(fun, row) {
            var _this = this;
            console.log(fun, row);
            if(fun.code=='IMPORT') {
                _this.$refs.importModel.show();
            } else if(fun.code=='SCDM') {
                var _this = this;
                window.open("/java/sys/model/generateCode?id=" + row.id);        
                // _this.myUtils.appRequest({
                //     url: '/java/sys/model/generateCode',
                //     method:'post',
                //     data:{id:row.id},
                //     callback:function(data) {
                //         _this.openFormData.formVisible = false;
                //         _this.$message({
                //             showClose: true,
                //             message: data.message,
                //             type: 'success'
                //         });
                //         _this.$emit('loadData');
                //     },
                //     catch: function(res) {
                //         console.log(res);
                //     }
                // }, _this);
            }
        }
    },
    components: { gridView, importModel }
};
</script>